package isvb;

import com.google.inject.AbstractModule;
import com.google.inject.Provides;
import isvb.impl.api.PromotionServiceIsvB;
import isvb.impl.model.MemberIsvB;
import isvb.impl.model.PromotionIsvB;
import isvb.impl.model.SkuIsvB;
import isvb.module.OrderLineProvider;
import isvb.module.OrderProvider;
import org.dormi.learn.promotion.api.PromotionService;
import org.dormi.learn.promotion.model.Member;
import org.dormi.learn.promotion.model.Order;
import org.dormi.learn.promotion.model.OrderLine;
import org.dormi.learn.promotion.model.Promotion;
import org.dormi.learn.promotion.model.Sku;

import java.math.BigDecimal;

/**
 * add description here
 *
 * @author : dormi330
 * @version : 1.0
 */
public class IsvBModule extends AbstractModule {

    @Override
    protected void configure() {
        super.configure();
        bind(Member.class).toProvider(IsvBModule::getMember);
        bind(Sku.class).toProvider(IsvBModule::getSku);
        bind(OrderLine.class).toProvider(OrderLineProvider.class);
        bind(Order.class).toProvider(OrderProvider.class);
        bind(Promotion.class).to(PromotionIsvB.class);
        bind(PromotionService.class).to(PromotionServiceIsvB.class);
    }

    @Provides
    static Member getMember() {
        return new MemberIsvB(1L, 10);
    }


    @Provides
    static Sku getSku() {
        return new SkuIsvB(1L, 1L, new BigDecimal("10.01"));
    }

}
